package com.blb.zy_community.utils;

import java.io.IOException;
import java.util.Properties;

/**
 * 配置工具类
 */
public class ConfigUtils {

    private static Properties properties = new Properties();

    static {
        try {
            properties.load(ConfigUtils.class.getClassLoader().getResourceAsStream("system.properties"));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    /**
     * 获取指定配置
     * @param key
     * @return
     */
    public static String get(String key){
        return properties.getProperty(key);
    }

    /**
     * 获取文件上传路径
     * @return
     */
    public static String getUploadPath(){
        return properties.getProperty("upload_dir");
    }
}
